package gui;

import java.util.ArrayList;

import skyproc.MajorRecord;
import skyproc.Mod;
import skyproc.FormID;
import edit.*;


public class RecordInformationTableModel extends TreeTableModModel {


	static protected ArrayList<String> cNames;

	@SuppressWarnings("rawtypes")
	static protected ArrayList<Class> cTypes;

	public RecordInformationTableModel(HolderInterface root) {
		super(root);
		
		cNames = new ArrayList<String>();
		
		cTypes = new ArrayList<Class>();
		
		cTypes.add(TreeTableModel.class);
		

		if(root != null) {
			
			cNames.add("");

			for(Mod mod : ((MajorRecordHolder) root).getMasters()) {
				
				cNames.add(mod.getName());

				cTypes.add(String.class);

			}

		} else {
			
			cNames.add("Names");
			cNames.add("Values");
			
		}
	}


	@Override
	public int getColumnCount() {
		return cNames.size();
	}

	@Override
	public String getColumnName(int column) {
		return cNames.get(column);
	}

	/**
	 * Returns the class for the particular column.
	 */
	 @SuppressWarnings("rawtypes")
	 public Class getColumnClass(int column) {
		 return cTypes.get(column);
	 }

}